<?php

namespace App\Models;

use Illuminate\Support\Facades\Cache;

class SettingModel extends BaseModel
{
    protected $guarded = [];

    protected $table   = 'setting';

    /**
     * 刷新缓存
     * @throws \Psr\SimpleCache\InvalidArgumentException
     */
    public static function flushCache()
    {
        Cache::store('file')->set("settings", self::all()->pluck('value', 'key')->toArray());
    }
}

